package com.hdyg.sixg.mvp.presenter;

import com.hdyg.sixg.entry.OrderBean;
import com.hdyg.sixg.httpUtil.HttpCallback;
import com.hdyg.sixg.mvp.Contrant.CFragTransChild;
import com.hdyg.sixg.mvp.base.BasePresenter;
import com.hdyg.sixg.util.ToastUtil;
import java.util.Map;

/**
 * @author CZB
 * @describe 全部挂售/我的挂售/我的购买/我的出售
 * @time 2019/4/12 9:54
 */
public class PFragTransChild extends BasePresenter implements CFragTransChild.IPFragTransChild {

    private CFragTransChild.IVFragTransChild mView;

    public PFragTransChild(CFragTransChild.IVFragTransChild mView) {
        this.mView = mView;
    }

    @Override
    public void pGetOrder(String path, Map<String, String> params) {
        mModel.post(path, params, new HttpCallback<OrderBean>(true) {
            @Override
            public void onSuccess(OrderBean dataBean) {
                mView.vGetOrderSuccess(dataBean);
            }

            @Override
            public void onFail(String code, String error) {
                ToastUtil.show(error);
            }
        });
    }

    @Override
    public void pGetDownSell(String path, Map<String, String> params) {
        mModel.post(path, params, new HttpCallback(true) {
            @Override
            public void onSuccess(Object dataBean) {
                mView.vGetDownSellSuccess(dataBean.toString());
            }

            @Override
            public void onFail(String code, String error) {
                ToastUtil.show(error);
            }
        });
    }

//    @Override
//    public void pGetAllOrder(String path, Map<String, String> params) {
//        mModel.post(path, params, new HttpCallback<OrderBean>(true) {
//            @Override
//            public void onSuccess(OrderBean dataBean) {
//                mView.vGetAllOrderSuccess(dataBean);
//            }
//
//            @Override
//            public void onFail(String code, String error) {
//                ToastUtil.show(error);
//            }
//        });
//    }
//
//    @Override
//    public void pGetHandUpOrder(String path, Map<String, String> params) {
//        mModel.post(path, params, new HttpCallback<OrderBean>(true) {
//            @Override
//            public void onSuccess(OrderBean dataBean) {
//                mView.vGetHandUpOrderSuccess(dataBean);
//            }
//
//            @Override
//            public void onFail(String code, String error) {
//                ToastUtil.show(error);
//            }
//        });
//    }
//
//    @Override
//    public void pGetBuyOrder(String path, Map<String, String> params) {
//        mModel.post(path, params, new HttpCallback<OrderBean>(true) {
//            @Override
//            public void onSuccess(OrderBean dataBean) {
//                mView.vGetBuyOrderSuccess(dataBean);
//            }
//
//            @Override
//            public void onFail(String code, String error) {
//                ToastUtil.show(error);
//            }
//        });
//    }
//
//    @Override
//    public void pGetSellOrder(String path, Map<String, String> params) {
//        mModel.post(path, params, new HttpCallback<OrderBean>(true) {
//            @Override
//            public void onSuccess(OrderBean dataBean) {
//                mView.vGetSellOrderSuccess(dataBean);
//            }
//
//            @Override
//            public void onFail(String code, String error) {
//                ToastUtil.show(error);
//            }
//        });
//    }
}
